<ion-view class="bg">
  <ion-header-bar class="bar bar-positive">
    <button class="button back-button buttons icon ion-ios-arrow-left button-clear" nav-direction="back" ng-click="$ionicGoBack()">返回</button>
    <h3 class="title">运单详情</h3>
  </ion-header-bar>
  <ion-content>
    <div ng-if="showloading" class="ion-spinner">
      <ion-spinner icon="lines" class="spinner-calm"></ion-spinner>
    </div>
    <div class="detail" ng-if="showloading == false">
      <img src="img/waybillNum.png">
      <i class="number">{{waybillDetail.WAYBILL_NO}}</i>
      <i class="date">{{waybillDetail.WAYBILL_DATE | date : "yyyy-MM-dd HH:mm:ss"}}</i>
    </div>
    <ion-list class="myList" ng-if="showloading == false">
      <div class="item item-input div">
        <i class="input-label col-25">承运状态</i>
        <i>{{WAYBILL_STATUS}}</i>
      </div>
      <div class="item item-input div">
        <i class="balanced">{{waybillDetail.DEPARTURE_STATION}}</i>
        <i class="ion-arrow-right-a value arrow-right" ng-if="waybillDetail.DESTINATION_NAME!=null"></i>
        <i class="value assertive">{{waybillDetail.DESTINATION_NAME}}</i>
        <i class="ion-arrow-right-a value arrow-right" ng-if="waybillDetail.DESTINATION_STATION!=null"></i>
        <i class="value energized">{{waybillDetail.DESTINATION_STATION}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">送货方式</i>
        <i>{{DELIVERY_TYPE}}</i>
      </div>
      <div ng-repeat="img in imgData" ng-if="imgData!=undefined&&showloading==false" style="width: 30%;height: 100px;overflow: hidden;float: left;margin: 6px;">
        <img  ng-src="data:image/jpg;base64,{{img}}" ng-click="showBigImage(img)" style="width: 100%;"/>
      </div>
      <div class="item item-input item-divider div" style="width: 100%;">
        <img src="img/shr_logo.png" class="typeIcon" style="height: 25px;">
        <i class="dark">收货信息</i>
      </div>
      <div class="item item-input div">
        <p class="col-50">{{waybillDetail.CONSIGNEE}}</p>
        <i class="col-50">{{waybillDetail.CONSIGNEE_PHONE}}</i>
      </div>
      <div class="address">
        {{waybillDetail.CONSIGNEE_ADDRESS}}
      </div>
      <div class="item item-input item-divider div">
        <img src="img/fhr_logo.png" class="typeIcon" style="height: 25px;">
        <i class="dark">发货信息</i>
      </div>
      <div class="item item-input div">
        <p class="col-50">{{waybillDetail.SHIPPER}}</p>
        <i class="col-50">{{waybillDetail.SHIPPER_PHONE}}</i>
      </div>
      <div class="address">
        {{waybillDetail.SHIPPER_ADDRESS}}
      </div>
      <div class="item item-input item-divider div" ng-if="waybillGoods!=null">
        <img src="img/fhxx_logo.png" class="typeIcon" style="height: 25px;">
        <i class="dark">货物信息</i>
      </div>
      <div class="item item-input div" ng-repeat="i in waybillGoods">
        <i class="col-33">{{i.GOODS_NAME}}</i>
        <i class="col-33">{{i.PIECES}}件</i>
        <i class="col-33">{{i.PACK_NAME}}</i>
      </div>
      <div class="item item-input item-divider div">
        <img src="img/fy_logo.png" class="typeIcon" style="height: 25px;">
        <i class="dark">费用信息</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">付款方式</i>
        <i>{{PAYMENT_METHOD}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">运费合计</i>
        <i>{{waybillDetail.FREIGHT_AMOUNT | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">提货费</i>
        <i class="col-25">{{waybillDetail.PICK_UP_COST | number:2}}</i>
        <i class="input-label col-25">送货费</i>
        <i class="col-25" ng-if="waybillDetail.DROP_OFF!=undefined">{{waybillDetail.DROP_OFF | number:2}}</i>
        <i class="col-25" ng-if="waybillDetail.DELIVERY_COST!=undefined">{{waybillDetail.DELIVERY_COST | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">声明价值</i>
        <i class="col-25">{{waybillDetail.DECLARE_VALUE | number:2}}</i>
        <i class="input-label col-25">保费</i>
        <i class="col-25">{{waybillDetail.PREMIUM | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">现返</i>
        <i class="col-25">{{waybillDetail.BACK_NOW | number:2}}</i>
        <i class="input-label col-25">欠返</i>
        <i class="col-25">{{waybillDetail.OWE_TO_RETURN | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">代收款</i>
        <i class="col-25">{{waybillDetail.AGENCY_FUND | number:2}}</i>
        <i class="input-label col-25">手续费</i>
        <i class="col-25" ng-if="waybillDetail.POINTS!=-1">{{waybillDetail.POINTS | number:2}}</i>
        <i class="col-25" ng-if="waybillDetail.POINTS==-1">0.00</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">运费垫付</i>
        <i>{{waybillDetail.PAYMENT_FREIGHT | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">代收款垫付</i>
        <i>{{waybillDetail.PAY_COLLECTION | number:2}}</i>
      </div>
      <div class="item item-input div">
        <i class="input-label col-25">回单份数</i>
        <i>{{waybillDetail.RECEIPT_NUM}}</i>
      </div>
      <div class="address">
        备注:{{waybillDetail.REMARK}}
      </div>
    </ion-list>
  </ion-content>
  <div id="bigImg" class="popover-backdrop hide" style="width: 100%;text-align: center;background-color: #000;" ng-click="hideBigImage()">
    <span style="height: 100%;display: inline-block;vertical-align: middle;"></span><img class="img-responsive" style="width: 100%;vertical-align: middle;" src="data:image/jpg;base64,{{Url}}"/>
  </div>
</ion-view>
